<?php $all_session = $this->session->all_userdata(); ?>
<!DOCTYPE html>
<!-- saved from url=(0056)http://startbootstrap.com/templates/simple-sidebar.html# -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title><?php echo $web_service[0]['web_name']; ?></title>
<script src="<?php echo base_url();?>js/chart.js"></script>
<?php $this->load->view('panel_head');?>
</head>

<body>
<style>
.dots {
	table-layout:fixed;
}

.dots p {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
</style>
<div style="height:46px; width:100%; position:fixed; z-index:10000;">
  <?php $this->load->view('header');?>
</div>
<div style="height:46px;"></div>

<!-- <div content at here>-->
<div id="page-content-wrapper"> 
  
  <!-- row -->
  <div class="row">
    <div class="col-md-12" align="center" style="margin-top:3em; margin-bottom:1.5em;"> <?php echo form_open('search/index');?>
      <input class="form-control" name="search" placeholder="Search..." style="width:50%;"/>
      &nbsp;<span class="glyphicon glyphicon-search"></span> <?php echo form_close();?> </div>
  </div>
  <!-- row -->
  
 
  
  <div class="row">
  	<div class="col-md-12" align="center" style="margin:0em 0; padding:0;" >
     
   			<?php echo form_open('search/index');?>
    
      
            <select class="form-control" style="width:16em; margin-bottom:1em;" name="result_by" id="result_by" onChange="this.form.submit()" >
              <?php if($all_session['result	_by'] == 'vdo.vdo_id') { ?>
              <option value="vdo.vdo_id">-- result by No. --</option>
              <?php } ?>
              <?php if($all_session['result_by'] == 'vdo_name') { ?>
              <option value="vdo_name">-- result by name --</option>
              <?php } ?>
              <?php if($all_session['result_by'] == 'vdo_uploadtime') { ?>
              <option value="vdo_uploadtime">-- result by uploaded time --</option>
              <?php } ?>      
              <?php if($all_session['result_by'] == 'vdo_dislike') { ?>
              <option value="vdo_dislike">-- result by dislike --</option>
              <?php } ?>
              <?php if($all_session['result_by'] == 'vdo_like') { ?>
              <option value="vdo_like">-- result by like --</option>
              <?php } ?>
              <?php if($all_session['result_by'] == 'vdo_view') { ?>
              <option value="vdo_view">-- result by view --</option>
              <?php } ?>
              <option value="vdo.vdo_id">result by No.</option>
              <option value="vdo_name">result by name</option>
              <option value="vdo_uploadtime">result by last upload</option>      
              <option value="vdo_dislike">result by dislike</option>
              <option value="vdo_like">result by like</option>
              <option value="vdo_view">result by view</option>
            </select>
			
            
    <select class="form-control" name="category_by" onChange="this.form.submit()" style="width:16em;">
    
    	<?php foreach($category as $by_name) { ?>
            <?php if($by_name['category_id'] == $all_session['category_by'] ) { ?>
             <option value="<?php echo $all_session['category_by'];?>">-- <?php echo $by_name['category_name']; ?>--</option>
             <?php } ?>
        <?php } ?>
            
            
           <option value="all">All category</option>
              <?php foreach ($category as $category)
				  	echo '<option value="'.$category['category_id'].'">'.$category['category_name'].'</option>';
			  ?>
    </select>

             
         <?php echo form_close();?>
    </div>
  </div>
  
   <?php if($search == '') { ?>
 <div class="row">
 	<div class="col-md-12" align="center">
    <h3><font color="#999999">-- Please enter the search term --</font></h3>
 	</div>
 </div>
  <?php } else if($search == null) { ?>
  <div class="row">
 	<div class="col-md-12" align="center">
    <h3><font color="#999999">-- Your search for '<?php echo $this->input->post('search');?> did not return any results --</font></h3>
 	</div>
 </div>
  <?php } ?>
  
  <div class="row">
 	<div class="col-md-12" align="center">
      <div class="pagination" style="margin:0 0 1.5em 0; padding:0;" >
        <?php 	echo $this->pagination->create_links(); ?>
        

        </div><!-- pagination -->
 	</div>
 </div>
  
  <?php $a = 0; $b = 1; ?>
  <?php for($i=0;$i<count($search)/2;$i++) {  ?>
  <div class="row" style="padding-left:1.9em;">
  
  	<div class="col-md-6" style="margin-bottom:2em;">
    	<div class="row">
        	<div class="col-md-6">
            	<a href="<?php echo base_url();?>index.php/player/cs/<?php echo @$search[$a]['vdo_id'];?>">
            	<img src="<?php echo base_url();?>vod_thumb/<?php echo @$search[$a]['vdo_rawfile'];?>/<?php echo @$search[$a]['thumb_name'];?>" width="95%" / >
                </a>
            </div>
            <div class="col-md-6">
            	 <a href="<?php echo base_url();?>index.php/player/cs/<?php echo @$search[$a]['vdo_id'];?>"><?php echo @$search[$a]['vdo_name'];?></a></br>
                  <div class="dots" style="width:70%;">
                      <p style="height:5em;">  <?php echo @$search[$a]['vdo_des'];?></p>
                    </div>
                 <font size="-2"><?php echo @$search[$a]['vdo_view'];?> views</font></br>
                 <font size="-2">Uploaded time : <?php echo @$search[$a]['vdo_uploadtime'];?></font>
            </div>
        </div>
    </div>
    
    
    
    <div class="col-md-6" style="margin-bottom:2em;">
    	<div class="row">
        	<div class="col-md-6">
            	<?php if(@$search[$b]['vdo_rawfile'] != '') { ?>
            	<a href="<?php echo base_url();?>index.php/player/cs/<?php echo @$search[$b]['vdo_id'];?>">
            	<img src="<?php echo base_url();?>vod_thumb/<?php echo @$search[$b]['vdo_rawfile'];?>/<?php echo @$search[$b]['thumb_name'];?>" width="95%" / >
                </a>
                <?php } ?>
            </div>
            <div class="col-md-6">
            	<a href="<?php echo base_url();?>index.php/player/cs/<?php echo @$search[$b]['vdo_id'];?>"><?php echo @$search[$b]['vdo_name'];?></a></br>
                 <div class="dots" style="width:70%;">
                      <p style="height:5em;">  <?php echo @$search[$b]['vdo_des'];?></p>
                    </div>
                 <?php if(@$search[$b]['vdo_id'] != '') { ?>
                 <font size="-2"><?php echo @$search[$b]['vdo_view'];?> views</font></br>
                 <font size="-2">Uploaded time : <?php echo @$search[$b]['vdo_uploadtime'];?></font>
                 <?php } ?>
            </div>
        </div>
    </div>
    
  </div>
  
  <?php $a+=2; $b+=2; ?>
  
  <?php } ?>
  
  
   <div class="row">
 	<div class="col-md-12" align="center">
      <div class="pagination" style="margin:0; padding:0 0 1.5em 0;" >
        <?php 	echo $this->pagination->create_links(); ?>
        

        </div><!-- pagination -->
 	</div>
 </div>
  
  
  
  
</div>

<!-- </div dontent at here>--> 

<!-- Custom JavaScript for the Menu Toggle --> 
<script>
    $("#menu-toggle").click(function(e) {
        e.preventDefault();
        $("#wrapper").toggleClass("active");
    });
</script>
</body>
</html>